{extend name="index/base" /}
{block name="main"}
<style>
    /*分页样式*/
    .pagination li{margin:0px 1px; padding: 1px 1px;display: inline-block;}
    .pagination .active span{ background-color: #1E9FFF; color: #fff;}

</style>
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 15px;">
        <legend>文章列表</legend>
        <div style="margin-top: 10px">
            <button class="layui-btn" onclick="location.href='{:url(\'create\')}'">添加信息</button>
        </div>

    </fieldset>

    <table class="layui-table">
        <thead>
        <tr>
            <th>ID</th>
            <th>标题</th>
            <th>分类</th>
            <th>状态</th>
            <th>添加时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        {volist name="list" id="vo"}
            <tr>
                <td>{$vo.id}</td>
                <td>{$vo.title}</td>
                <td>{$vo.type_id|get_category_title|raw}</td>
                <td>正常</td>
                <td>{$vo.create_time|date="Y-m-d"}</td>
                <td>
                    <a href="{:url('edit',array('id'=>$vo['id']))}" class="layui-btn layui-btn-xs">编辑</a>
                    <a href="{:url('delete',array('id'=>$vo['id']))}" class="layui-btn layui-btn-danger layui-btn-xs" onclick="return confirm('确定删除？')">删除</a>
                </td>
            </tr>
        {/volist}
        </tbody>
    </table>
    <div id="demo0" class="pages"><div class="layui-box layui-laypage layui-laypage-default" id="layui-laypage-1">{$list|raw}</div></div>
{/block}